package com.chg.mymvc.service;

import com.chg.mymvc.dao.ItemDaoImpl;
import com.chg.mymvc.entity.Item;

import java.util.List;

public class ItemServiceImpl implements ItemService{
    private ItemDaoImpl ii=new ItemDaoImpl();
    @Override
    public void delItem(int id) {
      ii.delItem(id);
    }

    @Override
    public void updateItem(Item item) {
    ii.updateItem(item);
    }

    @Override
    public List<Item> queryAll(int page, int pagesize) {
        return ii.queryAll(page,pagesize);
    }

    @Override
    public List<Item> getAllItem() {
        return ii.getAllItem();
    }

    @Override
    public Item getItemByName(String name) {
        return null;
    }

    @Override
    public int addItem(Item item) {

        return ii.addItem(item);
    }

    @Override
    public Item selecItemtById(int id) {
return ii.selecItemtById(id);
    }

    @Override
    public Item getNewsidByItemId(String name) {
        return ii.getNewsidByItemId(name);
    }

    @Override
    public int allcount() {
        return ii.allcount();
    }
}
